<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var isSubsequence = function(s, t) {
        if(s.length>t.length) return false;
        let left = 0;
        for(let i=0;i<t.length;i++){
            if(t[i]===s[left]){
                left++;
            }
        }
        return left===s.length;
    };
    console.log(isSubsequence("ab", "baab"))
</script>
</body>
</html>
